package labox.innovation.gameserver.model;

import java.util.List;

import labox.innovation.gameserver.model.actor.instance.FuzePcInstance;

public class L2FriendsNewsManager {

	private static L2FriendsNewsManager instance = new L2FriendsNewsManager();

	private L2FriendsNewsManager() {
	}

	/**
	 * @param msg
	 * @param out 可以为null,指定那些玩家不需要发送该动态消息
	 * 发送好友动态消息,除了out中指定的除外
	 */
	public void sendMessage(FriendsNews msg, List<Long> out) {
		List<Long> _tem = msg.getActive().getFriendInstance().getHeroesId();
		if (_tem == null)
			return;
		for (Long objid : _tem) {
			FuzePcInstance obj = FuzeWorld.getInstance().getPlayer(objid);
			if (obj != null) {
				if (out == null || !out.contains(objid))
					obj.getFriendInstance().addFriendNews(msg);
			}
		}
	}

	public static L2FriendsNewsManager getInstance() {
		return instance;
	}
}
